<?php

class Appordershensu_model extends Base_Model
{
    Const TABLE = 'app_order_shensu';

    public function __construct()
    {
        parent::__construct();
        $this->load->database();
    }

    /**
     * 获取申诉单
     *
     * @param $where
     * @return array
     */
    public function getShensu($where)
    {
        return $this->db->get_where(self::TABLE, $where)->row_array();
    }

    /**
     * 更新申诉单
     *
     * @param $data
     * @param $where
     * @return CI_DB_active_record|CI_DB_result
     */
    public function editShensu($data, $where)
    {
        return $this->db->update(self::TABLE, $data, $where);
    }

    /**
     * 添加申诉单
     *
     * @param $data
     * @return int
     */
    public function addShensu($data)
    {
        $this->db->insert(self::TABLE, $data);
        return $this->db->insert_id();
    }

}